package at.moop.up;

public class FTPCredentials {
	
	private String server;
	private String user;
	private String password;
	
	public FTPCredentials(String server, String user, String password) {
		super();
		this.server = server;
		this.user = user;
		this.password = password;
	}

	public FTPCredentials() {
	}

	public String getServer() {
		return server;
	}

	public void setServer(String server) {
		this.server = server;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append(this.getUser());
		sb.append("##");
		sb.append(this.getPassword());
		sb.append("##");
		sb.append(this.getServer());
		return sb.toString();
	}
	
	public void createFromString(String msg){
		String tokens[] = msg.split("##");
		this.setUser(tokens[0]);
		this.setPassword(tokens[1]);
		this.setServer(tokens[2]);
	}

}
